{extend name="public/login_template"}
{block name="title"}{$site_title}{/block}
{block name="main-content"}
<div class="admin_login_wrap">
    <div class="adming_login_border">
        <div class="admin_input">
            <form class="login_form" method="post">
                <ul class="admin_items">
                    <li>
                        <label for="user">用户名：</label>
                        <input  id="user" type="text" name="username" size="35" class="admin_input_style"/>
                    </li>
                    <li style="height:16px;">
                        <span class="error-username" style="color: #f00;display: none;"></span>
                    </li>
                    <li>
                        <label for="pwd">密码：</label>
                        <input id="pwd" type="password" name="password" size="35" class="admin_input_style" />
                    </li>
                    <li style="height:30px;">
                        <span class="error-pwd" style="display: none;color: #f00;"></span>
                    </li>
                    <li>
                        <input type="button" tabindex="3" value="登录" class="btn btn-primary" />
                    </li>
                </ul>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
    $('#user').blur(function () {
       var username = $(this).val();
       var str = '* 用户名不能为空！';
       valid(username,str,1);
    });

    $("#pwd").blur(function () {
        var pwd = $(this).val();
        var str ='* 密码不能为空！';
        valid(pwd,str,2);
    });

    $(document).keydown(function (ev) {
        if(ev.keyCode == 13){
            $("input[type=button]").click();
        }
    })

    $("input[type=button]").click(function () {
        login();
    });

</script>
{/block}
